/* Functions to detect the browser and the version */

function getBrowser() {
    var browser_id = navigator.userAgent.toLowerCase();
    var result = '';

    if (findString(browser_id, 'konqueror')) result = "konqueror";
    else if (findString(browser_id, 'opera')) result = "opera"
    else if (findString(browser_id, 'msie')) result = "msie"
    else if (findString(browser_id, 'mozilla')) result = "mozilla"
    else result = "unknown";

    return result;
} // get_browser


function getVersion() {
    var result = '';
    var browser_id = navigator.userAgent.toLowerCase();

    browser = getBrowser();
    id_ind = findString(browser_id, browser);

    result = browser_id.charAt(id_ind + browser.length);

    return result;
}


function findString(HeyStack, Needle)
{
    index = HeyStack.indexOf(Needle)+1;
    return index;
}
